﻿<Window x:Class="SharpF2.View.UndoManagerDialog"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Commands="clr-namespace:SharpF2.Commands"
    xmlns:ModelView="clr-namespace:SharpF2.ModelView"
    xmlns:Components="clr-namespace:SharpF2.Components"
    xmlns:Services="clr-namespace:SharpF2.Services"
    Title="{Services:Language UndoManagerDialogTitle}" 
    Height="400" Width="700"
    Icon="../SharpF2Icon.ico"
    AllowDrop="True"
    WindowStartupLocation="CenterOwner"
    Components:FrameworkElementExtension.DropCommand="{Binding DropItemsCommand}"
    Background="{StaticResource MainBackgroundBrush}">
    <Window.Resources>
        <Commands:CommandReference x:Key="RemoveUndoFileItemCommandReference" Command="{Binding RemoveUndoFileCommand}"/>
    </Window.Resources>
    <Grid Margin="4,4,4,4">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <TextBlock Grid.Row="0" Height="Auto" Margin="0,0,0,0" VerticalAlignment="Top"  Foreground="White" 
                   Text="{Services:Language UndoManagerDialogInstruction}"/>
        <ModelView:UndoLogFileItemListView Grid.Row="1" Margin="0,4,0,2"           
                                  Style="{StaticResource ListViewStyle}"
                                  ItemsSource="{Binding Path=LogFileItems}"
                                  SelectedItem="{Binding Path=LogFileSelectedItem, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                  ColumnsSource="{Binding UndoLogFileItemColumns}"
                                  SelectionMode="Single">
            <ListView.View>
                <GridView/>
            </ListView.View>
        </ModelView:UndoLogFileItemListView>
        <GridSplitter Grid.Row="2" Margin="0,2,0,2" Height="4" VerticalAlignment="Top" HorizontalAlignment="Stretch"/>
        <ModelView:UndoFileListView Grid.Row="2" Margin="0,8,0,0" 
                                    Style="{StaticResource ListViewStyle}"
                                    ItemsSource="{Binding Path=UndoFileItems}"
                                    SelectedItemsSource="{Binding Path=SelectedUndoFileItems, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                    ColumnsSource="{Binding UndoFileItemColumns}"
                                    SelectionMode="Extended">
            <ListView.View>
                <GridView/>
            </ListView.View>
            <ListView.InputBindings>
                <KeyBinding Key="Delete" Command="{StaticResource RemoveUndoFileItemCommandReference}"/>
            </ListView.InputBindings>
        </ModelView:UndoFileListView>
        <Button Grid.Row="3" HorizontalAlignment="Right" Margin="0,4,4,4" MinWidth="100" MinHeight="24" Padding="10,4"
                Command="{Binding UndoCommand}" 
                Content="{Services:Language Rename}"/>
    </Grid>
</Window>
